package kz.pompei.var.atom;

import java.io.PrintStream;

public abstract class Atom {
  private final String content;
  private final int startLine, startCol;
  
  public Atom(int startLine, int startCol, String content) {
    this.startLine = startLine;
    this.startCol = startCol;
    this.content = content;
  }
  
  public String getContent() {
    return content;
  }
  
  public int getStartLine() {
    return startLine;
  }
  
  public int getStartCol() {
    return startCol;
  }
  
  @Override
  public String toString() {
    return getClass().getSimpleName() + "[" + content + "] "
        + getClass().getSimpleName() + " started at line " + getStartLine()
        + ", col " + getStartCol();
  }
  
  public void print(PrintStream out) {
    out.print( content );
  }
}
